/*
* Copyright 2018 Shanxi Lu'an Taihang Laihui Net Tech co.,LTD.
*/
package com.laihuichuxing.flyweight;/**
 * Description:
 *
 * @author: Qinxuefeng
 * @since: 1.0
 * Create Date Time: 2019/1/2 15:12
 * Update Date Time:
 */

public class Main {
    public static void main(String[] args) {
        int extrinsicState=22;
        FlyWeightFactory flyWeightFactory = new FlyWeightFactory();
        FlyWeight x = flyWeightFactory.getFlyWeight("x");
        x.operation(--extrinsicState);
        FlyWeight y = flyWeightFactory.getFlyWeight("y");
        y.operation(--extrinsicState);
        FlyWeight z = flyWeightFactory.getFlyWeight("z");
        z.operation(--extrinsicState);
        FlyWeight uf = new UnsharedConcreteFlyWeight();
        uf.operation(--extrinsicState);
        System.out.println(z==y);
    }
}
